package com.lemon.core.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 认证方式枚举
 *
 * @author pan
 * @since 2019-11-06
 */
@Getter
@AllArgsConstructor
public enum AuthenticationMethodEnum {

    /**
     * 用户名
     */
    USERNAME("username", "用户名"),
    MOBILE("mobile", "手机号"),
    OPENID("openId", "开放式认证系统唯一身份标识");

    private final String value;

    private final String label;

    public static AuthenticationMethodEnum getByValue(String value) {
        for (AuthenticationMethodEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

}
